#ifndef GMAIN_H
#define GMAIN_H

struct Node
{
    int x;
    int y;
    int dir;
};

struct Character
{
	int x;
	int y;
	int xpixel;
	int ypixel;
	int charDirection;
	int charAnimationNumber;
	int charMovementNumber;
	
	std::queue<Node> movementQueue;

	std::vector<int> equip;

	std::string charname;
	std::string lastMessage;
	int messageTimeout;
};

class GMain : public XWindow
{
	public:
        GMain(XResourcesManager *data);
        void Draw();

        void CheckState(const sf::Input &input);
		void CheckEvent(const sf::Event &Event);
		void CheckQuery();

	private:
		sf::RenderWindow* x_app;

		std::vector<std::vector< int > > m_vectLayer1;
        std::vector<std::vector< int > > m_vectLayer2;
        std::vector<std::vector< int > > m_vectLayer3;
        std::vector<std::vector< int > > m_vectLayer4;

        std::vector<int> m_vectLayerPassability;

		std::map<int, Character> m_charInfo;

        sf::Sprite m_tilesetSprite;
		sf::Sprite m_selector;

        std::string m_mapName;
        std::string m_mapTileset;

        int m_mapSizeX;
        int m_mapSizeY;

		int x_offsetX;
		int x_offsetY;

		int x_lastTargetX;
		int x_lastTargetY;
		bool x_isDoneMoving;

		int x_charDirection;
		int x_charAnimationNumber;
		int x_charMovementNumber;

		int m_messageTimeout;

		std::queue<Node> m_movementQueue;

        sf::Music m_bgmusic;

		bool m_mapLoaded;

		bool m_chatActivated;
};

#endif